<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>菜鸟教程 React 实例</title>
    <script src="https://cdn.bootcss.com/react/15.4.2/react.min.js"></script>
    <script src="https://cdn.bootcss.com/react/15.4.2/react-dom.min.js"></script>
    <script src="https://cdn.bootcss.com/babel-standalone/6.22.1/babel.min.js"></script>
  </head>
  <body>
    <div id="example"></div>
    <script type="text/babel">
      
      var Success = React.createClass({
      getInitialState: function(){
          return {
            target:'目标要清晰，要量化，实现目标的路线一定要清楚',
            active:'往着成功的路线坚持不懈的行动',
            slogan:'好好学习，天天向上'
          }
        },
        render: function() {
          return (
          <div>
            <Target target={this.state.target}></Target>
            <Active active={this.state.active}></Active>
          </div>
          )
        }
      });
      var Target = React.createClass({
        render: function() {
          return <div>{this.props.target}</div>;
        }

      })
      var Active = React.createClass({
      render: function(){
        return <div data-active={this.props.active}>{this.props.active}</div>
      }
    })
      ReactDOM.render(
        <Success/>,
        document.getElementById('example')
      );
    </script>
  </body>
</html>